Properties of Congruences

Introduction

The Meaning of Congruence mod $m$

Equivalence Classes and Remainders

Well‑Defined Operations on Congruence Classes

Addition mod $m$

Multiplication mod $m$

Subtraction and Negatives mod $m$

Exponentiation mod $m$

Division mod $m$

Division in modular arithmetic is more subtle than addition, subtraction, or multiplication. It only works when the number you want to divide by has a multiplicative inverse modulo $m$.

What does division mean mod $m$?

When does an inverse exist?

Examples

How to compute an inverse (conceptually)

For beginners, it’s enough to know:

Example: Find the inverse of $7$ mod $12$

Advanced readers can solve the linear diophantine equation: $$ax + my = 1$$

Using division once the inverse is known

To compute $$\frac{a}{b} \pmod{m},$$ rewrite it as $$a \cdot b^{-1} \pmod{m}.$$ Example: Compute $6 / 3 \pmod{7}$

Key takeaways

When Operations Are (and Aren’t) Well‑Defined

Working with Modular Identities

Common Pitfalls and Misconceptions

Applications of Modular Arithmetic

Exercises

  1. Compute $17 + 29 \pmod{12}$.

    Solution

    Compute $17 + 29 \pmod{12}$

    • Step 1: $17 + 29 = 46$
    • Step 2: Divide $46$ by $12$:
      • $12 \cdot 3 = 36$, remainder $10$
    • Answer: $$17 + 29 \equiv 10 \pmod{12}$$
  2. Compute $45 - 62 \pmod{9}$.

    Solution

    Compute $45 - 62 \pmod{9}$

    • Step 1: $45 - 62 = -17$
    • Step 2: Reduce $-17$ mod $9$:
      • Add $9$ twice: $-17 + 18 = 1$
    • Answer: $$45 - 62 \equiv 1 \pmod{9}$$
  3. Compute $8 \cdot 14 \pmod{11}$.

    Solution

    Compute $8 \cdot 14 \pmod{11}$

    • Step 1: $8 \cdot 14 = 112$
    • Step 2: Reduce $112$ mod $11$:
      • $11 \cdot 10 = 110$, remainder $2$
    • Answer: $$8 \cdot 14 \equiv 2 \pmod{11}$$
  4. Compute $3^5 \pmod{7}$.

    Solution

    Compute $3^5 \pmod{7}$

    • Step 1: $3^2 = 9 \equiv 2 \pmod{7}$
    • Step 2: $3^4 = (3^2)^2 \equiv 2^2 = 4 \pmod{7}$
    • Step 3: $3^5 = 3^4 \cdot 3 \equiv 4 \cdot 3 = 12 \equiv 5 \pmod{7}$
    • Answer: $$3^5 \equiv 5 \pmod{7}$$
  5. Determine whether $37 \equiv -8 \pmod{5}$.

    Solution

    Determine whether $37 \equiv -8 \pmod{5}$

    • Step 1: Reduce $37$ mod $5$:
      • $37 = 5 \cdot 7 + 2$, so $37 \equiv 2 \pmod{5}$
    • Step 2: Reduce $-8$ mod $5$:
      • $-8 + 10 = 2$, so $-8 \equiv 2 \pmod{5}$
    • Conclusion: Both are congruent to $2$ mod $5$.
    • Answer: $$37 \equiv -8 \pmod{5}$$
  6. Reduce each number mod $6$:
    • $19$
    • $-4$
    • $28$

    Solution

    Reduce each number mod $6$: $19$, $-4$, $28$

    • $19 \pmod{6}$:
      • $6 \cdot 3 = 18$, remainder $1$
      • $19 \equiv 1 \pmod{6}$
    • $-4 \pmod{6}$:
      • $-4 + 6 = 2$
      • $-4 \equiv 2 \pmod{6}$
    • $28 \pmod{6}$:
      • $6 \cdot 4 = 24$, remainder $4$
      • $28 \equiv 4 \pmod{6}$
    • Answer: $$19 \equiv 1,\quad -4 \equiv 2,\quad 28 \equiv 4 \pmod{6}$$
  7. Compute $27 \cdot 19 \pmod{8}$ using early reduction.

    Solution

    Compute $27 \cdot 19 \pmod{8}$ using early reduction

    • Step 1: Reduce first:
      • $27 \equiv 3 \pmod{8}$ (since $27 - 24 = 3$)
      • $19 \equiv 3 \pmod{8}$ (since $19 - 16 = 3$)
    • Step 2: Multiply reduced numbers:
      • $3 \cdot 3 = 9$
    • Step 3: Reduce $9$ mod $8$:
      • $9 \equiv 1 \pmod{8}$
    • Answer: $$27 \cdot 19 \equiv 1 \pmod{8}$$
  8. Find the additive inverse of $5$ mod $13$.

    Solution

    Find the additive inverse of $5$ mod $13$

    • Goal: Find $x$ such that $$5 + x \equiv 0 \pmod{13}$$
    • Step 1: Think of $-5$ mod $13$:
      • $-5 + 13 = 8$
    • Check: $5 + 8 = 13 \equiv 0 \pmod{13}$
    • Answer:
      The additive inverse of $5$ mod $13$ is $8$.
  9. Division: Does $4$ have a multiplicative inverse mod $10$?
    • If yes, find it.
    • If no, explain why division by $4$ is not possible.

    Solution

    Division: Does $4$ have a multiplicative inverse mod $10$?

    • Check gcd:
      • $\gcd(4, 10) = 2 \neq 1$
    • Conclusion:
      • Since $4$ and $10$ are not coprime, $4$ has no inverse mod $10$.
      • Therefore, division by $4$ is not well‑defined mod $10$.
    • Answer:
      $4$ does not have a multiplicative inverse mod $10$.
  10. Division: Compute $6 / 3 \pmod{7}$ by finding the inverse of $3$.

    Solution

    Division: Compute $6 / 3 \pmod{7}$ by finding the inverse of $3$

    • Step 1: Find $3^{-1} \pmod{7}$:
      • Try small numbers:
        • $3 \cdot 1 = 3 \not\equiv 1$
        • $3 \cdot 2 = 6 \not\equiv 1$
        • $3 \cdot 3 = 9 \equiv 2$
        • $3 \cdot 4 = 12 \equiv 5$
        • $3 \cdot 5 = 15 \equiv 1 \pmod{7}$
      • So $3^{-1} \equiv 5 \pmod{7}$.
    • Step 2: Rewrite division as multiplication: $$\frac{6}{3} \equiv 6 \cdot 3^{-1} \equiv 6 \cdot 5 \pmod{7}$$
    • Step 3: Compute $6 \cdot 5 = 30 \equiv 2 \pmod{7}$
    • Answer: $$6 / 3 \equiv 2 \pmod{7}$$
  11. Compute $123 + 456 + 789 \pmod{9}$.

    Solution

    Compute $123 + 456 + 789 \pmod{9}$

    You can either add first or use the digit‑sum trick for mod $9$.

    • Method 1: Direct sum
      • $123 + 456 = 579$
      • $579 + 789 = 1368$
      • Reduce $1368$ mod $9$:
        • Sum of digits: $1 + 3 + 6 + 8 = 18$
        • $18 \equiv 0 \pmod{9}$
    • Method 2: Reduce each term mod $9$
      • $123 \equiv 1 + 2 + 3 = 6 \pmod{9}$
      • $456 \equiv 4 + 5 + 6 = 15 \equiv 6 \pmod{9}$
      • $789 \equiv 7 + 8 + 9 = 24 \equiv 6 \pmod{9}$
      • Total: $6 + 6 + 6 = 18 \equiv 0 \pmod{9}$
    • Answer: $$123 + 456 + 789 \equiv 0 \pmod{9}$$